Skip to main content

optionalUserMessage

OptionalUserMessage Model​

Defines the structure used to create a chat with an optional initial user message, message metadata, chat metadata, and optional file attachments.


message (string, Optional)​

The main text content of the user's message. Either message or at least one file_{n} field must be provided. HTML content is not allowed.


file_{n} (file, Optional)​

One or more uploaded files using dynamic field names such as file_1, file_2, etc. This is available for multipart form requests.

Allowed content types include PDF, PNG, JPEG, DOCX, XLSX, plain text, Markdown, and TeX-related text formats.


metadata (object, Optional)​

A dictionary of key-value pairs stored on the initial user message.


metadata_{n} (object, Optional)​

Metadata for the matching uploaded file. For example, metadata_1 applies to file_1.


chat_metadata (object, Optional)​

A dictionary of key-value pairs stored on the chat itself. The backend persists these as chat metadata records and returns them in the chat metadata object.

When sent in multipart form data, this field may be provided as a valid JSON string.


Example​

{
"message": "string",
"metadata": {
"source": "landing-page"
},
"chat_metadata": {
"channel": "web",
"customer_id": "123"
}
}